import request from '@/config/axios'

// 员工提现 VO
export interface WithdrawVO {
  id: number // id
  staffId: number // 员工id
  orderNum: string // 提现编号
  money: number // 提现金额
  status: number // 状态 0 提现中 1 已到账
  staffName: string // 员工姓名
  payAccount:string //银行账号
  payName:string //账户所有者
}

// 员工提现 API
export const WithdrawApi = {
  // 查询员工提现分页
  getWithdrawPage: async (params: any) => {
    return await request.get({ url: `/peizhen/withdraw/page`, params })
  },

  // 查询员工提现详情
  getWithdraw: async (id: number) => {
    return await request.get({ url: `/peizhen/withdraw/get?id=` + id })
  },

  // 新增员工提现
  createWithdraw: async (data: WithdrawVO) => {
    return await request.post({ url: `/peizhen/withdraw/create`, data })
  },

  // 修改员工提现
  updateWithdraw: async (data: WithdrawVO) => {
    return await request.put({ url: `/peizhen/withdraw/update`, data })
  },

  checkWithdraw:async (data: WithdrawVO)=> {
    return await request.put({ url: `/peizhen/withdraw/check`, data })
  },

  // 删除员工提现
  deleteWithdraw: async (id: number) => {
    return await request.delete({ url: `/peizhen/withdraw/delete?id=` + id })
  },

  // 导出员工提现 Excel
  exportWithdraw: async (params) => {
    return await request.download({ url: `/peizhen/withdraw/export-excel`, params })
  },

}
